# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=iaxscan
pkgver=0.02
pkgrel=4
groups=('blackarch' 'blackarch-scanner' 'blackarch-cracker')
pkgdesc='A Python based scanner for detecting live IAX/2 hosts and then enumerating (by bruteforce) users on those hosts.'
arch=('any')
url='http://code.google.com/p/iaxscan/'
license=('mozilla')
depends=('python2')
source=("https://dl.packetstormsecurity.net/UNIX/scanners/$pkgname-$pkgver.tar.gz")
sha512sums=('5bd1615481ee33170c8945f712d489e6d188e5b6a59eed83e486d0ef60b09255f87c5a0c9f9b8de9db43aaa5b206d15730e9e950173b1f74130a9bf0da8b2ce0')

package() {
  cd "$pkgnmae-$pkgver"

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/iaxscan"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.txt
  install -Dm 644 LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  rm README.txt LICENSE.txt

  cp -a * "$pkgdir/usr/share/$pkgname/"

  cat > "$pkgdir/usr/bin/iax-scan-hosts" << EOF
#!/bin/sh
cd /usr/share/$pkgname
python2 scan_hosts.py "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/iax-scan-hosts"

  cat > "$pkgdir/usr/bin/iax-scan-users" << EOF
#!/bin/sh
cd /usr/share/$pkgname
python2 scan_users.py "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/iax-scan-users"
}

